﻿using System.Collections.Generic;
using System.Xml;

namespace HuaXingSDK.Response
{
    public class Res流标查询 : HXSyncResponse
    {
        public string Return_Status { get; private set; }
        public RSItem[] RSList { get; private set; }

        public Res流标查询(string outerXml) : base(outerXml)
        {
            if (RSList == null)
            {
                RSList = new RSItem[0];
            }
        }

        protected override void SetValue(XmlNode node)
        {
            base.SetValue(node);

            if (node.Name.OICEquals(nameof(RSList)))
            {
                var args = new List<RSItem>();
                args.AddRange(RSList);
                args.Add(new RSItem(node.OuterXml));
                RSList = args.ToArray();
            }
        }

        public class RSItem : XmlToEntity
        {
            public string ReqseqNo { get; private set; }
            public string LoanNo { get; private set; }
            public string ACNo { get; private set; }
            public string ACName { get; private set; }
            public decimal Amount { get; private set; }
            public string Status { get; private set; }
            public string ErrorMsg { get; private set; }
            public string HostDT { get; private set; }
            public string HostJNLno { get; private set; }

            protected internal RSItem(string outerXml) : base(outerXml)
            {

            }
        }
    }
}
